package com.sunwayworld.basemodule.coredata.judgmentbasis.resource.impl;

import com.sunwayworld.basemodule.coredata.judgmentbasis.resource.LimsJudgmentBasisResource;
import com.sunwayworld.basemodule.coredata.judgmentbasis.service.LimsJudgmentBasisService;
import com.sunwayworld.basemodule.coredata.judgmentbasis.validators.LimsJudgmentDeleteTableValidator;
import com.sunwayworld.framework.log.annotation.Log;
import com.sunwayworld.framework.log.annotation.LogModule;
import com.sunwayworld.framework.log.annotation.LogType;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;
import com.sunwayworld.framework.spring.annotation.GikamBean;
import com.sunwayworld.framework.validator.data.annotation.ValidateDataWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@LogModule("判断依据管理")
@RestController
@GikamBean
public class LimsJudgmentBasisResourceImpl implements LimsJudgmentBasisResource {

    @Autowired
    private LimsJudgmentBasisService limsJudgmentBasisService;

    @Override
    public LimsJudgmentBasisService getService() {
        return limsJudgmentBasisService;
    }

    @Log(value = "新增判断依据管理", type = LogType.INSERT)
    @Override
    @RequestMapping(method = RequestMethod.POST)
    public Long insert(RestJsonWrapperBean wrapper) {
        return getService().insert(wrapper);
    }

    @Log(value = "删除", type = LogType.DELETE)
    @Override
    @ValidateDataWith(LimsJudgmentDeleteTableValidator.class)
    public void delete(RestJsonWrapperBean wrapper) {
        getService().delete(wrapper);
    }
}
